	Report = function(){}
	Report.pieData="";//用于保存饼状图数据
    Report.poleData="";//用于保存柱状图数据
    Report.lineData="";//线状图
    Report.searchChart="";
    Report.searchSecondChart="";
    Report.clearData = function(){ //清空数据
    	Report.pieData="";//用于保存饼状图数据
        Report.poleData="";//用于保存柱状图数据
        Report.lineData="";//线状图
    }
	Report.init=function(subModule){
    	 //Report.loadBoard();
    	$('div.nav #header_report').attr("class","active");
    	 Report.loadsubModule(subModule);
    }

    Report.loadsubModule = function(subModule){
		if(subModule==undefined || subModule==null || subModule==''){
			//return;
			MonthExpenseReport.list();
		}else{
			subModule.list();	//此处不严谨。不是每个模块，都有list这个方法。
		}
	}

    //通用2D
    Report.search2DPie = function(options){
		var chartData = JSON.parse(options.data);
		var seriesData = [];
		for(var i in chartData.rows){
			var row = chartData.rows[i];
			seriesData.push({
				name: row.name,
				y: parseFloat(row.val)
			});
		}
		Highcharts.chart(options.area, {
			chart: {
				plotBackgroundColor: null,
				plotBorderWidth: null,
				plotShadow: false,
				type: 'pie'
			},
			title: {
				text: ''
			},
			tooltip: {
				pointFormat: '{series.name}: <b>{point.y:.2f}</b>'
			},
			plotOptions: {
				pie: {
					allowPointSelect: true,
					cursor: 'pointer',
					dataLabels: {
						enabled: true,
						format: '<b>{point.name}</b>: {point.y:.2f}'
					}
				}
			},
			series: [{
				name: '',
				colorByPoint: true,
				data: seriesData
			}]
		});
    }

    //通用3D
    Report.search3DPie = function(options){
    	Report.pieData=options.data;
    	var so = new SWFObject("components/chart/ampie/ampie.swf", "caakee", "100%", "100%", "2", "#FFFFFF");
   		so.addVariable("loading_data", "正在加载...");
   		so.addParam("wmode","transparent");//让flash和网页成一体
       	so.addVariable("path", "components/chart/ampie/");
   		so.addVariable("settings_file", encodeURIComponent("components/chart/ampie/ampie_settings.xml?"+rnd()));
   		so.addVariable("chart_data", encodeURIComponent(options.data));
   		so.write(options.area);
    }

    //2D柱状图
    Report.alter2DPole = function(options){
		var chartData = JSON.parse(options.data);
		Highcharts.chart(options.area, {
			chart: {
				type: 'column'
			},
			title: {
				text: ''
			},
			xAxis: {
				categories: chartData.categories,
				crosshair: true
			},
			yAxis: {
				title: {
					text: ''
				}
			},
			plotOptions: {
				column: {
					pointPadding: 0.2,
					borderWidth: 0
				}
			},
			series: chartData.series
		});

    }

    //3D柱状图
    Report.alter3DPole = function(options){
		var chartData = JSON.parse(options.data);
		Highcharts.chart(options.area, {
			chart: {
				type: 'column'
			},
			title: {
				text: ''
			},
			xAxis: {
				categories: chartData.categories,
				crosshair: true
			},
			yAxis: {
				title: {
					text: ''
				}
			},
			plotOptions: {
				column: {
					pointPadding: 0.2,
					borderWidth: 0
				}
			},
			series: chartData.series
		});

    }

    //3D柱状图
    Report.alter3DBar = function(options){
    	Report.poleData=options.data;
		var so = new SWFObject("components/chart/amcolumn/amcolumn.swf", "caakee", "100%", "100%", "2", "#FFFFFF");
		so.addVariable("loading_data", "正在加载...");
		so.addParam("wmode","transparent");//让flash和网页成一体
    	so.addVariable("path", "components/chart/amcolumn/");
		so.addVariable("settings_file", encodeURIComponent("components/chart/amcolumn/3d_bar_settings.xml?"+rnd()));
		so.addVariable("chart_data", encodeURIComponent(options.data));
        so.write(options.area);

    }

    //线状图
    Report.alterLine = function(options){
    	Report.lineData=options.data;
        var chartData = JSON.parse(options.data);
        Highcharts.chart(options.area, $.extend({
            chart: {
                type: 'line'
            },
            title: {
                text: ''
            },
            xAxis: {
                categories: chartData.categories,
                crosshair: true
            },
            yAxis: {
                title: {
                    text: ''
                }
            },
            plotOptions: {
                column: {
                    pointPadding: 0.2,
                    borderWidth: 0
                }
            },
            series: chartData.series
        }, options));

    }

//////////////////////////////////ExpenseReport//////////////////////////
	ExpenseReport = function(){}
    //
    ExpenseReport.list = function(){
    	Report.clearData();
        $('#main').load('/report/expenseReport.php?method='+rnd(),'',function(){
        	Help.show(3003,0);
        	ExpenseReport.search();
        	Report.searchChart = ExpenseReport.search2DPie;
        	Report.searchChart();
        });
    }

    ExpenseReport.search=function(){
    	var zone = 'dataView';
  	    var form='schForm';
    	var url = '/report/expenseReport.php?method=listQry'+rnd();
    	submitSearch(form,url+rnd(),zone,function(){
        });
    };

  //2d pie
    ExpenseReport.search2DPie=function(){
    	var url ="/report/expenseReport.php?method=pie";
    	submitSearchChart('schForm',url+rnd(),Report.search2DPie,{area:'chartView',data:Report.pieData});

    }
    //3d pie
    ExpenseReport.search3DPie=function(){
    	var url ="/report/expenseReport.php?method=pie";
    	submitSearchChart('schForm',url+rnd(),Report.search3DPie,{area:'chartView',data:Report.pieData});
    }
    //2d柱状图
    ExpenseReport.alter2DPole=function(){
    	var url ="/report/expenseReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter2DPole,{area:'chartView',data:Report.poleData});
    }

    //3d柱状图
    ExpenseReport.alter3DPole=function(){
    	var url ="/report/expenseReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
    }

  //导出数据
    ExpenseReport.onExport= function(){
    	var url = ctx+'/report/expenseReport.php?method=onExport';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }

//////////////////////////////////decoExpenseReport//////////////////////////
	DecoExpenseReport = function(){}
    //
	DecoExpenseReport.list = function(){
    	Report.clearData();
        $('#main').load('/report/decoExpenseReport.php?method=list'+rnd(),'',function(){
        	Help.show(3016,0);
        	DecoExpenseReport.search();
        	Report.searchChart = DecoExpenseReport.search2DPie;
        	Report.searchChart();
        });
    }

	DecoExpenseReport.search=function(){
    	var zone = 'dataView';
  	    var form='schForm';
    	var url = '/report/decoExpenseReport.php?method=listQry'+rnd();
    	submitSearch(form,url+rnd(),zone,function(){
        });
    };

  //2d pie
    DecoExpenseReport.search2DPie=function(){
    	var url ="/report/decoExpenseReport.php?method=pie";
    	submitSearchChart('schForm',url+rnd(),Report.search2DPie,{area:'chartView',data:Report.pieData});

    }
    //3d pie
    DecoExpenseReport.search3DPie=function(){
    	var url ="/report/decoExpenseReport.php?method=pie";
    	submitSearchChart('schForm',url+rnd(),Report.search3DPie,{area:'chartView',data:Report.pieData});
    }
    //2d柱状图
    DecoExpenseReport.alter2DPole=function(){
    	var url ="/report/decoExpenseReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter2DPole,{area:'chartView',data:Report.poleData});
    }

    //3d柱状图
    DecoExpenseReport.alter3DPole=function(){
    	var url ="/report/decoExpenseReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
    }

  //导出数据
    DecoExpenseReport.onExport= function(){
    	var url = ctx+'/report/decoExpenseReport.php?method=onExport';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }




/////////////////////////////////IncomeReport///////////////////////////////
    IncomeReport = function(){}

    IncomeReport.list = function(){
    	Report.clearData();
    	$('#main').load('/report/incomeReport.php?method='+rnd(),'',function(){
    		Help.show(3004,0);
    		IncomeReport.search();
    		Report.searchChart = IncomeReport.search2DPie;
    		Report.searchChart();
    	});
    }

    IncomeReport.search = function(){
    	var zone = 'dataView';
    	var form = 'schForm';
    	var url = '/report/incomeReport.php?method=listQry';
    	submitSearch(form, url+rnd(), zone, function(){
    	});
    }

  //2d pie
    IncomeReport.search2DPie=function(){
    	var url ="/report/incomeReport.php?method=pie";
    	submitSearchChart('schForm',url+rnd(),Report.search2DPie,{area:'chartView',data:Report.pieData});

    }
    //3d pie
    IncomeReport.search3DPie=function(){
    	var url ="/report/incomeReport.php?method=pie";
    	submitSearchChart('schForm',url+rnd(),Report.search3DPie,{area:'chartView',data:Report.pieData});
    }
    //2d柱状图
    IncomeReport.alter2DPole=function(){
    	var url ="/report/incomeReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter2DPole,{area:'chartView',data:Report.poleData});
    }

    //3d柱状图
    IncomeReport.alter3DPole=function(){
    	var url ="/report/incomeReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
    }

  //导出数据
    IncomeReport.onExport= function(){
    	var url = ctx+'/report/incomeReport.php?method=onExport';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }

///////////////////////////////////DailyReport///////////////////////////////////
    DailyReport = function(){}

    DailyReport.list = function(){
    	Report.clearData();
    	$('#main').load('/report/dailyReport.php?method='+rnd(),'',function(){
    		Help.show(3001,0);
    		DailyReport.search();
    		Report.searchChart = DailyReport.alter3DPole;
    		Report.searchChart();
    	});
    }

    DailyReport.search = function(){
    	var zone = 'dataView';
    	var form = 'schForm';
    	var url = '/report/dailyReport.php?method=listQry';
    	submitSearch(form, url+rnd(), zone, function(){
    	});
    }
  //3d柱状图
    DailyReport.alter3DPole=function(){
    	var url ="/report/dailyReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
    }


  //导出数据
    DailyReport.onExport= function(){
    	var url = ctx+'/report/dailyReport.php?method=onExport';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }


	///////////////////////////////////MonthExpenseReport///////////////////////////////////
	MonthExpenseReport = function(){}

	MonthExpenseReport.list = function(){
		Report.clearData();
		$('#main').load('/report/monthExpenseReport.php?method='+rnd(),'',function(){
			Help.show(3001,0);
			MonthExpenseReport.search();
			Report.searchChart = MonthExpenseReport.alter3DPole;
			Report.searchChart();
		});
	}

	MonthExpenseReport.search = function(){
		var zone = 'dataView';
		var form = 'schForm';
		var url = '/report/monthExpenseReport.php?method=listQry';
		submitSearch(form, url+rnd(), zone, function(){
		});
	}
	//3d柱状图
	MonthExpenseReport.alter3DPole=function(){
		var url ="/report/monthExpenseReport.php?method=pole";
		submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
	}

///////////////////////////////////MonthAssetReport///////////////////////////////////
	MonthAssetReport = function(){}

	MonthAssetReport.list = function(){
    $('#main').load('/report/monthAssetReport.php?method='+rnd(),'',function(){
      Report.searchChart = MonthAssetReport.alter3DPole;
      Report.searchChart();
    });
	}

	//3d柱状图
	MonthAssetReport.alter3DPole=function(){
		var url ="/report/monthAssetReport.php?method=pole";
		submitSearchChart('schForm',url+rnd(),Report.alter3DPole, {area:'chartView',data:Report.poleData});
	}

////////////////////////////////ExpenseAnnulusReport/////////////////////////////
    ExpenseAnnulusReport = function(){}

    ExpenseAnnulusReport.list = function(){
    	Report.clearData();
    	$('#main').load('/report/expenseAnnulusReport.php?method='+rnd(),'',function(){
    		Help.show(3011,0);
    		ExpenseAnnulusReport.search();
    		Report.searchChart = ExpenseAnnulusReport.alter2DPole;
    		Report.searchChart();
    	});
    }

    ExpenseAnnulusReport.search = function(){
    	var zone = 'dataView';
    	var form = 'schForm';
    	var url = '/report/expenseAnnulusReport.php?method=listQry';
    	submitSearch(form, url+rnd(), zone, function(){
    	});
    }

  //2d柱状图
    ExpenseAnnulusReport.alter2DPole=function(){
    	var url ="/report/expenseAnnulusReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter2DPole,{area:'chartView',data:Report.poleData});
    }

    //3d柱状图
    ExpenseAnnulusReport.alter3DPole=function(){
    	var url ="/report/expenseAnnulusReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
    }

  //3d柱状图
    ExpenseAnnulusReport.alter3DBar=function(){
    	var url ="/report/expenseAnnulusReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DBar,{area:'chartView',data:Report.poleData});
    }

    //折线图
    ExpenseAnnulusReport.alterLine=function(){
    	var url ="/report/expenseAnnulusReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alterLine,{area:'chartView',data:Report.poleData});
    }

  //导出数据
    ExpenseAnnulusReport.onExport= function(){
    	var url = '/report/expenseAnnulusReport.php?method=onExport';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }

////////////////////////////////IncomeAnnulusReport/////////////////////////////
    IncomeAnnulusReport = function(){}

    IncomeAnnulusReport.list = function(){
    	Report.clearData();
    	$('#main').load('/report/incomeAnnulusReport.php?method='+rnd(),'',function(){
    		Help.show(3012,0);
    		IncomeAnnulusReport.search();
    		Report.searchChart = IncomeAnnulusReport.alter2DPole;
    		Report.searchChart();
    	});
    }

    IncomeAnnulusReport.search = function(){
    	var zone = 'dataView';
    	var form = 'schForm';
    	var url = '/report/incomeAnnulusReport.php?method=listQry';
    	submitSearch(form, url+rnd(), zone, function(){
    	});
    }

  //2d柱状图
    IncomeAnnulusReport.alter2DPole=function(){
    	var url ="/report/incomeAnnulusReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter2DPole,{area:'chartView',data:Report.poleData});
    }

    //3d柱状图
    IncomeAnnulusReport.alter3DPole=function(){
    	var url ="/report/incomeAnnulusReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
    }

  //3d柱状图
    IncomeAnnulusReport.alter3DBar=function(){
    	var url ="/report/incomeAnnulusReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DBar,{area:'chartView',data:Report.poleData});
    }

    //折线图
    IncomeAnnulusReport.alterLine=function(){
    	var url ="/report/incomeAnnulusReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alterLine,{area:'chartView',data:Report.poleData});
    }

  //导出数据
    IncomeAnnulusReport.onExport= function(){
    	var url = '/report/incomeAnnulusReport.php?method=onExport';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }



/////////////////////////////////CapitalOutReport///////////////////////////////////
    CapitalOutReport = function(){}

    CapitalOutReport.list = function(){
    	Report.clearData();
    	$('#main').load('/report/capitalOutReport.php?method='+rnd(),'',function(){
    		Help.show(3005,0);
    		CapitalOutReport.search();
    		Report.searchChart = CapitalOutReport.search2DPie;
    		Report.searchChart();
    	});
    }

    CapitalOutReport.search = function(){
    	var zone = 'dataView';
    	var form = 'schForm';
    	var url = '/report/capitalOutReport.php?method=listQry';
    	submitSearch(form, url+rnd(), zone, function(){
    	});
    }

  //2d pie
    CapitalOutReport.search2DPie=function(){
    	var url ="/report/capitalOutReport.php?method=pie";
    	submitSearchChart('schForm',url+rnd(),Report.search2DPie,{area:'chartView',data:Report.pieData});

    }
    //3d pie
    CapitalOutReport.search3DPie=function(){
    	var url ="/report/capitalOutReport.php?method=pie";
    	submitSearchChart('schForm',url+rnd(),Report.search3DPie,{area:'chartView',data:Report.pieData});
    }
    //2d柱状图
    CapitalOutReport.alter2DPole=function(){
    	var url ="/report/capitalOutReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter2DPole,{area:'chartView',data:Report.poleData});
    }

    //3d柱状图
    CapitalOutReport.alter3DPole=function(){
    	var url ="/report/capitalOutReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
    }

  //导出数据
    CapitalOutReport.onExport= function(){
    	var url = '/report/capitalOutReport.php?method=onExport';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }

////////////////////////////////CapitalInReport///////////////////////////////////

    CapitalInReport = function(){}

    CapitalInReport.list = function(){
    	Report.clearData();
    	$('#main').load('/report/capitalInReport.php?method='+rnd(),'',function(){
    		Help.show(3006,0);
    		CapitalInReport.search();
    		Report.searchChart = CapitalInReport.search2DPie;
    		Report.searchChart();
    	});
    }

    CapitalInReport.search = function(){
    	var zone = 'dataView';
    	var form = 'schForm';
    	var url = '/report/capitalInReport.php?method=listQry';
    	submitSearch(form, url+rnd(), zone, function(){
    	});
    }

  //2d pie
    CapitalInReport.search2DPie=function(){
    	var url ="/report/capitalInReport.php?method=pie";
    	submitSearchChart('schForm',url+rnd(),Report.search2DPie,{area:'chartView',data:Report.pieData});

    }
    //3d pie
    CapitalInReport.search3DPie=function(){
    	var url ="/report/capitalInReport.php?method=pie";
    	submitSearchChart('schForm',url+rnd(),Report.search3DPie,{area:'chartView',data:Report.pieData});
    }
    //2d柱状图
    CapitalInReport.alter2DPole=function(){
    	var url ="/report/capitalInReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter2DPole,{area:'chartView',data:Report.poleData});
    }

    //3d柱状图
    CapitalInReport.alter3DPole=function(){
    	var url ="/report/capitalInReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
    }


  //导出数据
    CapitalInReport.onExport= function(){
    	var url = '/report/capitalInReport.php?method=onExport';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }

///////////////////////////////////CapitalOutMonthReport//////////////////////////////
    CapitalOutMonthReport = function(){}

    CapitalOutMonthReport.list = function(){
    	Report.clearData();
    	$('#main').load('/report/capitalOutMonthReport.php?method='+rnd(),'',function(){
    		Help.show(3014,0);
    		CapitalOutMonthReport.search();
    		Report.searchChart = CapitalOutMonthReport.search2DPie;
    		Report.searchChart();
    	});
    }

    CapitalOutMonthReport.search = function(){
    	var zone = 'dataView';
    	var form = 'schForm';
    	var url = '/report/capitalOutMonthReport.php?method=listQry';
    	submitSearch(form, url+rnd(), zone, function(){
    	});
    }

  //2d pie
    CapitalOutMonthReport.search2DPie=function(){
    	var url ="/report/capitalOutMonthReport.php?method=pie";
    	submitSearchChart('schForm',url+rnd(),Report.search2DPie,{area:'chartView',data:Report.pieData});

    }
    //3d pie
    CapitalOutMonthReport.search3DPie=function(){
    	var url ="/report/capitalOutMonthReport.php?method=pie";
    	submitSearchChart('schForm',url+rnd(),Report.search3DPie,{area:'chartView',data:Report.pieData});
    }
    //2d柱状图
    CapitalOutMonthReport.alter2DPole=function(){
    	var url ="/report/capitalOutMonthReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter2DPole,{area:'chartView',data:Report.poleData});
    }

    //3d柱状图
    CapitalOutMonthReport.alter3DPole=function(){
    	var url ="/report/capitalOutMonthReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
    }

  //导出数据
    CapitalOutMonthReport.onExport= function(){
    	var url = '/report/capitalOutMonthReport.php?method=onExport';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }
///////////////////////////////////CapitalInMonthReport//////////////////////////////

    CapitalInMonthReport = function(){}

    CapitalInMonthReport.list = function(){
    	Report.clearData();
    	$('#main').load('/report/capitalInMonthReport.php?method='+rnd(),'',function(){
    		Help.show(3015,0);
    		CapitalInMonthReport.search();
    		Report.searchChart = CapitalInMonthReport.search2DPie;
    		Report.searchChart();
    	});
    }

    CapitalInMonthReport.search = function(){
    	var zone = 'dataView';
    	var form = 'schForm';
    	var url = '/report/capitalInMonthReport.php?method=listQry';
    	submitSearch(form, url+rnd(), zone, function(){
    	});
    }

  //2d pie
    CapitalInMonthReport.search2DPie=function(){
    	var url ="/report/capitalInMonthReport.php?method=pie";
    	submitSearchChart('schForm',url+rnd(),Report.search2DPie,{area:'chartView',data:Report.pieData});

    }
    //3d pie
    CapitalInMonthReport.search3DPie=function(){
    	var url ="/report/capitalInMonthReport.php?method=pie";
    	submitSearchChart('schForm',url+rnd(),Report.search3DPie,{area:'chartView',data:Report.pieData});
    }
    //2d柱状图
    CapitalInMonthReport.alter2DPole=function(){
    	var url ="/report/capitalInMonthReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter2DPole,{area:'chartView',data:Report.poleData});
    }

    //3d柱状图
    CapitalInMonthReport.alter3DPole=function(){
    	var url ="/report/capitalInMonthReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
    }

  //导出数据
    CapitalInMonthReport.onExport= function(){
    	var url = '/report/capitalInMonthReport.php?method=onExport';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }

///////////////////////////yearReport////////////////////////////////////

    YearReport = function(){}

    YearReport.list = function(){
    	Report.clearData();
    	$('#main').load('/report/yearReport.php?method='+rnd(),'',function(){
    		Help.show(3010,0);
    		YearReport.search();
    		Report.searchChart = YearReport.alter3DPole;
    		Report.searchChart();
    	});
    }

    YearReport.search = function(){
    	var zone = 'dataView';
    	var form = 'schForm';
    	url = '/report/yearReport.php?method=listQry';;
    	submitSearch(form,url+rnd(),zone,function(){

    	});
    }

    //3d柱状图
    YearReport.alter3DPole=function(){
    	var url ="/report/yearReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
    }

    //导出数据
    YearReport.onExport= function(){
    	var url = ctx+'/report/yearReport.php?method=onExport';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }

/////////////////////////////////SeasonReport//////////////////////////////////
    SeasonReport = function(){}

    SeasonReport.list = function(){
    	Report.clearData();
    	$('#main').load('/report/seasonReport.php?method='+rnd(),'',function(){
    		Help.show(3009,0);
    		SeasonReport.search();
    		Report.searchChart = SeasonReport.alter3DPole;
    		Report.searchChart();
    	});
    }

    SeasonReport.search = function(){
    	var zone = 'dataView';
    	var form = 'schForm';
    	url = '/report/seasonReport.php?method=listQry';;
    	submitSearch(form,url+rnd(),zone,function(){

    	});
    }

    //3d柱状图
    SeasonReport.alter3DPole=function(){
    	var url ="/report/seasonReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
    }


  //导出数据
    SeasonReport.onExport= function(){
    	var url = ctx+'/report/seasonReport.php?method=onExport';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }


///////////////////////////////MonthReport//////////////////////////////
    MonthReport = function(){}

    MonthReport.list = function(){
    	Report.clearData();
    	$('#main').load('/report/monthReport.php?method='+rnd(),'',function(){
    		Help.show(3008,0);
    		MonthReport.search();
    		Report.searchChart = MonthReport.alter3DPole;
    		Report.searchChart();
            MonthReport.alterLineChart();
    	});
    }

    MonthReport.search = function(){
    	var zone = 'dataView';
    	var form = 'schForm';
    	url = '/report/monthReport.php?method=listQry';;
    	submitSearch(form,url+rnd(),zone,function(){
            MonthReport.alterLineChart();
    	});
    }

    //3d柱状图
    MonthReport.alter3DPole=function(){
        var url ="/report/monthReport.php?method=pole";
        submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
    }

    MonthReport.alterLineChart=function(){
        var url ="/report/monthReport.php?method=line";
        submitSearchChart('schForm', url + rnd(), Report.alterLine, {
        	area: 'lineView',
			data: Report.lineData,
            tooltip: {
                formatter: function () {
                    var s = '<strong>' +
                        this.x +
                        '</strong><br />';
                    s += "期末结余"+this.y+"元<br />";

                    var index = this.point.index;
                    var points = this.series.points;
                    if(index>0){
                    	var lastVal = points[index-1].y;
                    	var diff = this.y - lastVal;
                        s += "本期储蓄"+diff.toFixed(2)+"元<br />";
					}

                    return s;
                }
            }
        });
    }

    //导出数据
    MonthReport.onExport= function(){
    	var url = ctx+'/report/monthReport.php?method=onExport';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }

///////////////////////////////MonthCategoryReport//////////////////////////////
    MonthCategoryReport = function(){}

    MonthCategoryReport.list = function(){
    	Report.clearData();
    	$('#main').load('/report/monthCategoryReport.php?method='+rnd(),'',function(){
    		Help.show(3002,0);
    		MonthCategoryReport.search();
    		Report.searchChart = MonthCategoryReport.alter3DPole;
    		Report.searchChart();
    	});
    }

    MonthCategoryReport.search = function(){
    	var zone = 'dataView';
    	var form = 'schForm';
    	url = '/report/monthCategoryReport.php?method=listQry';
    	submitSearch(form,url+rnd(),zone,function(){

    	});
    }

    //3d柱状图
    MonthCategoryReport.alter3DPole=function(){
    	var url ="/report/monthCategoryReport.php?method=pole";
    	submitSearchChart('schForm',url+rnd(),Report.alter3DPole,{area:'chartView',data:Report.poleData});
    }

    //导出数据
    MonthCategoryReport.onExport= function(){
    	var url = ctx+'/report/monthCategoryReport.php?method=onExport';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }

///////////////////////balanceSheet////////////////////////////////////////
    function BalanceSheet(){}
    BalanceSheet.search = function(){};

    //查询数据
    BalanceSheet.searchList = function(params){
	    var zone = 'dataView';
	    var form='schForm';
        url = '/report/balanceSheet.php?method=listQry';
        if (params) {url +=params;}
        submitSearch(form,url+rnd(),zone,function(){});
    }
    BalanceSheet.search=BalanceSheet.searchList;

    BalanceSheet.list = function(){
        $('#main').load('/report/balanceSheet.php?method=execute'+rnd(),'',function(){
           Help.show(3007,0);
           BalanceSheet.search();
        });
    }

    //导出数据
    BalanceSheet.onExport= function(){
    	var url = ctx+'/report/balanceSheet.php?method=exportExl';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }


///////////////////////////tagReport/////////////////////////////////
    function TagReport(){}
    TagReport.pg = new Page('listtb');//列表页面
    //查询
    TagReport.search = function(params){
	    var zone = 'dataView';
	    var form='schForm';
	    var action='/report/tagReport.php?method=listQry';
        url = action;
        if (TagReport.pg.params) {url +=TagReport.pg.params;}
        submitSearch(form,url+rnd(),zone,function(){TagReport.pg.init();});
    }
    TagReport.pg.query = TagReport.search;

    TagReport.list = function(){
        $('#main').load('/report/tagReport.php?method='+rnd(),'',function(){
           Help.show(3013,0);
           TagReport.search();
        });
    }


  //导出数据
    TagReport.onExport= function(){
    	var url = ctx+'/report/tagReport.php?method=exportExl';
    	var formId = 'schForm';
	  	submitExport(formId,url);
    }

///////////////////////////////////ReportDetail/////////////////////////////////////

    ReportDetail = function(){}
    ReportDetail.pg = new Page('reportDetailList');
    ReportDetail.afterPick;
    var openId;

    ReportDetail.pg.query =

    //查询数据
    ReportDetail.search = function(){
    	var formId = 'schForm';
    	var url = ctx+'/report/reportDetail_listQry.php?oid='+openId;
    	var zone = 'reportDataView';
    	if(ReportDetail.pg.params){
    		url += ReportDetail.pg.params;
    	}
    	submitSearch(formId, url+rnd(), zone, function(){
    		ReportDetail.pg.init();
    	});
    }

  //弹出窗口
    ReportDetail.open = function(oid){
    	ReportDetail.pg.params='';
    	openId = oid;
    	CM.open('/report/reportDetail_list.php?'+rnd(),{title:'详细信息',size:WINDOW_L},function(){
    		ReportDetail.search();
    	});
    }


  //弹出窗口
    ReportDetail.openDaily = function(oid){

    	var year = $('#year').val();
    	var month = $('#month').val();
    	var dateFrom;
    	var dateTo;
    	if(month=='10'||month=='11'||month=='12'){
    		dateFrom = year+'-'+month+'-01';
        	dateTo = year+'-'+month+'-31';
    	}else{
    		dateFrom = year+'-0'+month+'-01';
        	dateTo = year+'-0'+month+'-31';
    	}
    	$('#dateFrom').val(dateFrom);
    	$('#dateTo').val(dateTo);

    	ReportDetail.open(oid);
    }


	//弹出窗口
	ReportDetail.openByTimeRangeExcludeFilter = function(start, end){
		$('#dateFrom').val(start);
		$('#dateTo').val(end);

		ReportDetail.pg.params='';
		openId = "";
		CM.open('/report/reportDetail_list.php?'+rnd(),{title:'详细信息',size:WINDOW_L},function(){
			var formId = 'schForm';
			var url = ctx+'/report/monthExpenseReport.php?method=monthOut';
			var zone = 'reportDataView';
			if(ReportDetail.pg.params){
				url += ReportDetail.pg.params;
			}
			submitSearch(formId, url+rnd(), zone, function(){
				ReportDetail.pg.init();
			});
		});
	}

///////////////////////////////////ReportCapitalDetail/////////////////////////////////////

    ReportCapitalDetail = function(){}
    ReportCapitalDetail.pg = new Page('reportDetailList');
    ReportCapitalDetail.afterPick;
    var openId;
    var openSign;

    ReportCapitalDetail.pg.query =

    //查询数据
    ReportCapitalDetail.search = function(){
    	var formId = 'schForm';
    	var url = '/report/reportDetail_listCapitalQry.php?oid='+openId+"&sign="+openSign;
    	var zone = 'reportDataView';
    	if(ReportCapitalDetail.pg.params){
    		url += ReportCapitalDetail.pg.params;
    	}
    	submitSearch(formId, url+rnd(), zone, function(){
    		ReportCapitalDetail.pg.init();
    	});
    }

    //弹出窗口
    ReportCapitalDetail.open = function(oid,sign){
    	openId = oid;
    	openSign = sign;
    	CM.open('/report/reportDetail_list.php?'+rnd(),{title:'详细信息',size:WINDOW_L},function(){
    		ReportCapitalDetail.search();
    	});
    }








